<template>
<div>
  <!-- 面包屑导航区 -->
  <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">商品</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-table :data="shoplist" height="250" border style="width: 100%">
        <el-table-column prop="goods_name" label="商品名" width="180"> </el-table-column>
        <el-table-column prop="goods_logo" label="商品logo" width="180"> </el-table-column>
        <el-table-column prop="goods_number" label="商品编号"> </el-table-column>
        <el-table-column prop="goods_price" label="商品价格"> </el-table-column>
        <el-table-column prop="market_price" label="market_price"> </el-table-column>
      </el-table>

      <el-main>
          <!-- 路由占位符 -->
          <router-view></router-view>
      </el-main>

      <!-- 分页 -->
      <!-- <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="1"
        background
        :page-sizes="[2, 3, 5, 10]"
        :page-size="queryinfo.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination> -->
  </div>
</template>

<script>
import axios from "axios"
export default {
  data() {
    return {
      // queryinfo: {
      //   page: 1,
      //   keyword: "",
      //   //每页显示条目数
      //   pageSize: 2,
      // },
      shoplist: [],
      total:0,
    };
  },
  methods: {
    getshop() {
      // 获取商品列表
      axios.get("http://adminapi.pyg.com/goods/index", { params: this.shoplist }).then((res) => {
          console.log(res);
          var { data } = res.data;
          this.shoplist = data;
                 //总条目数
          // this.total = data.total;
        });
    },
    // 监听pagesize改变时间
    handleSizeChange(newsize) {
      // console.log(newsize);
      this.queryinfo.pageSize = newsize;
      this.getuser();
    },

    //  监听当前页面改变事件
    handleCurrentChange(newPage) {
      this.queryinfo.page = newPage;
      this.getuser();
    },
  },
  mounted() {
      this.getshop();
  },
};
</script>
<style scoped>
.el-card {
  margin-top: 20px;
  box-shadow: 5 5 0 0.5;
}
.el-table {
  margin-top: 15px;
}
.el-pagination {
  margin-top: 15px;
}
</style>